<template>
	<u-popup :show="pupu_show" mode="center"  @close.stop="pu_close" >
		<view class="show_box_us" >
			<view class="pupu_box">
				<view class="text">{{title}}</view>
				<view class="shuom">
					<view class="list_yuan" v-for="(phone,idx) in hand_plat_phones">
						<view class="number">{{phone}}</view>
						<view class="iconfont phone" @click="call_phone(phone)">&#xe681;</view>
					</view>
				</view>
				<view class="xx" @click.stop="pu_close">关闭</view>
			</view>
		</view>
	</u-popup>
</template>

<script>
	export default {
		props:{
			sid : {
				type : Number,
				default : 0
			},
			urlstr :{
				type : String,
				default : '',
			},
			hand_plat_phones :{
				type : Array,
				default : ()=>[]
			},
			title :{
				type : String,
				default : '联系平台'
			},
			pupu_show :{
				type : Boolean,
				default: false
			},
		},
		data(){
			return {
				
			}
			
		},
		methods:{
			pu_close() {
				// this.pupu_show = false;
				// console.log(this.pupu_show);
				this.$emit('pu_close');
			},
			call_phone(phone){
				uni.makePhoneCall({
					phoneNumber: phone, //仅为示例
					success: (res) => {
						this.$emit('pu_close');
						if(this.sid){
							this.call_hand(this.sid)
						}
						
					}
				});
			},
			call_hand(id) {
				let url = this.site_url + 'api/index/call_hand?id=' + id;
				if(this.urlstr !== ''){
					url = this.site_url+this.urlstr+'?id='+id;
				}
				this.areq(url).then(res => {
				})
			},
		}
	}
</script>

<style lang="scss">
	
	.show_box_us {
		width: 100%;
		height: 100%;
		background-color: rgba(0, 0, 0, 0.5);
	}
	.show_box_us .pupu_box {
		width: 90%;
		position: relative;
		background-color: #fff;
		padding: 3vw 0vw;
		border-radius: 3vw;
		text-align: center;
		top: 0;
		left: 5%;
	}
	.show_box_us .pupu_box .text {
		width: 100%;
		font-size: 16px;
		color: #333;
		font-weight: bold;
	}
	.show_box_us .shuom {
		width: 90%;
		margin: 3vw auto;
		text-align: left;
		overflow-y: scroll;
		max-height: 63vw;
		display: flex;
		align-items: center;
		flex-wrap: wrap;
	
	}
	.show_box_us .list_yuan {
		width: 70%;
		margin: auto;
		display: flex;
		justify-content: space-around;
		align-items: center;
		height: 12vw;
		border-bottom: 4rpx solid rgba(0, 0, 0, 0.08);
		.name {
			color: #999;
			font-size: 3.5vw;
		}
		.number {
			font-size: 4.5vw;
			color: #333;
			margin: 0vw 3vw;
			font-weight: bold;
		};
		.phone {
			color: #333;
			font-size: 4.5vw;
		};
	}
	.xx {
		color: #2440c4;
		font-size: 3.5vw;
		margin: 0 auto;
	}
</style>